<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var arr = [4,3,5,1,4,6,2,1,5,3,1,6,2,4,6,2]
        console.log(arr);
        // 双重for循环去重
        // for(var i = 0 ;i<arr.length-1;i++){
        //     for(var j = i+1;j<arr.length; j++){
        //         if(arr[i] == arr[j]){
        //             arr.splice(j,1);
        //             j--;
        //         }
        //     }
        // }
        // console.log(arr);
        // var arr1 = new Array();
        // var obj = {};
        // for(var i = 0; i<arr.length;i++){
        //      if(obj[arr[i]] === undefined){
        //         obj[arr[i]] = 1;
        //         arr1.push(arr[i]);
        //      }
        // }
        // console.log(arr1)
        var arr2 = Array.from(new Set(arr))
        console.log(arr2)
    </script>
</body>
</html>